.PHONY: all clean
.SUFFIXES: .lg

WARN_CFLAGS        = -Wall -Wextra -Wformat=2-Wstrict-aliasing=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wfloat-equal -Wpointer-arith -Wswitch-enum -Winline -finline-functions
ANSI_CFLAGS        = -ansi -pedantic
INCLUDE_FLAGS      = -I.
CFLAGS             = -O2 $(ANSI_CFLAGS) $(WARN_CFLAGS) $(INCLUDE_FLAGS) -g

FILES = echo examples

LINEGUIDE = ../lineguide

.lg :
	$(LINEGUIDE) $<
	$(CC) $(CFLAGS) $*.c -o $*

all: $(FILES)

clean:
	rm -rf *.o *.c $(FILES)
